
/**
** \file       exec_for.c
**
** \brief      this function execute for rule
**
** \author     Ben M'rad Hanna, Laterem Hamza, Boillot Ulysse, De Olivera
**             Guillaume and Nguyen Viet Dung
**
** \version    1.0
**
** \date       28 November 2010
**
*/

#include "execution.h"

int             exec_for(s_rulefor              *node)
{
  s_word        *tmp_word = NULL;

  if (node->in_for != NULL)
  {
    tmp_word = node->in_in;

    while (tmp_word)
    {
      if (exec_dogroup(node->in_do))
        return (1);

      tmp_word = tmp_word->next;
    }
    return (0);
  }
  return (1);
}
